import request from '@/utils/request'
// 知识库接口列表

// 知识内容列表全部
export function contentList() {
  return request({
    url: '/call-center/api/v1/knowledgeBase/',
    method: 'get'
  })
}
// 知识内容新增
export function contentAdd(data) {
  return request({
    url: '/call-center/api/v1/knowledgeBase/insert',
    method: 'post',
    data: data
  })
}
// 知识内容详情
export function contentDetail(id) {
  return request({
    url: '/call-center/api/v1/knowledgeBase/' + id,
    method: 'get'
  })
}
// 知识内容修改
export function contentUpdate(data) {
  return request({
    url: '/call-center/api/v1/knowledgeBase/update',
    method: 'post',
    data: data
  })
}
// 知识内容删除
export function contentDelete(id) {
  return request({
    url: '/call-center/api/v1/knowledgeBase/' + id,
    method: 'delete'
  })
}
// 知识内容删除批量
export function contentDeleteBatch(ids) {
  return request({
    url: '/call-center/api/v1/knowledgeBase/deleteBatch',
    method: 'delete',
    data: ids
  })
}
// 知识内容审核
export function knowledgeBaseAudit(data) {
  return request({
    url: '/call-center/api/v1/knowledgeBase/audit',
    method: 'post',
    data
  })
}

// 排行榜查询
export function rankingList() {
  return request({
    url: '/call-center/api/v1/knowledgeQuery/queryRank',
    method: 'get'
  })
}

// 知识查询
export function queryKnowledge(keyWord) {
  return request({
    url: '/call-center/api/v1/knowledgeQuery/queryKnowledge?keyword=' + keyWord,
    method: 'post'
  })
}

// 知识查询(根据id)
export function queryKnowledgeById(id) {
  return request({
    url: '/call-center/api/v1/knowledgeQuery/' + id,
    method: 'get'
  })
}

// 模板下载
export function templateDownload() {
  return request({
    url: '/call-center/api/v1/knowledgeBase/download',
    method: 'get',
    responseType: 'blob'
  })
}
